package com.ssw.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 孙常胜
 * @CreateTime: 2021/7/30 18:12
 * @Description:实时刷新配置
 */
@RestController
@RequestMapping("test")
@RefreshScope
public class TestController {
    @Value("${users.name}")
    private String usersName;
    @Value("${users.age}")
    private int usersAge;

    @RequestMapping("get")
    public String get() {
        return usersName + "----" + usersAge;
    }

}
